home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / filter19.arc / FILTER.DOC < prev    next >
Text File  |  1987-01-21  |  6KB  |  149 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                Filter by Bill Todd
  8.  
  9.                                  Copyright 1986
  10.  
  11.                   This program is placed in the public domain.
  12.  
  13.           ------------------------------------------------------------
  14.  
  15.                              DISCLAIMER OF WARRANTY
  16.  
  17.           THIS  SOFTWARE  AND  DOCUMENTATION  ARE  PROVIDED "AS IS" AND
  18.           WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY.  ANY
  19.           STATEMENTS  MADE  BY  ANY  PERSON  ABOUT THIS SOFTWARE DO NOT
  20.           CONSTITUTE WARRANTIES AND SHALL NOT BE RELIED ON  BY THE USER
  21.           IN DECIDING WHETHER TO USE THESE PROGRAMS.
  22.  
  23.           THIS  PROGRAM  IS  PROVIDED  WITHOUT  ANY  EXPRESS OR IMPLIED
  24.           WARRANTIES  WHATSOEVER.    BECAUSE   OF   THE   DIVERSITY  OF
  25.           CONDITIONS  AND  HARDWARE  UNDER  WHICH THESE PROGRAMS MAY BE
  26.           USED, NO WARRANTY OF  FITNESS  FOR  A  PARTICULAR  PURPOSE IS
  27.           OFFERED.    THE  USER  IS  ADVISED  TO  TEST  THESE  PROGRAMS
  28.           THOROUGHLY BEFORE RELYING ON THEM.  THE USER  MUST ASSUME THE
  29.           ENTIRE  RISK  OF  USING  THESE  PROGRAMS.    ANY LIABILITY OF
  30.           PROVIDER  OR  MANUFACTURER  WILL  BE  LIMITED  EXCLUSIVELY TO
  31.           PRODUCT REPLACEMENT.
  32.  
  33.           -------------------------------------------------------------
  34.  
  35.           This  program  reformats  files.    Fields  may be deleted or
  36.           reordered. Characters may be inserted at  any location within
  37.           a record,  at the  beginning of each record, or at the end of
  38.           each record.  If the input records end with a carriage return
  39.           line feed  sequence it  can be  removed.   If not, a carriage
  40.           return line  feed may  be added.  Changes to  the records are
  41.           controlled  by  parameters  in  a  map file. The map file may
  42.           contain the following directives.
  43.  
  44.           Size :         The input  record size  including the carriage
  45.                          return and  line feed at the end of the record
  46.                          (if  present).   NOTE:     This  directive  is
  47.                          required.
  48.  
  49.           Noreturn:      Do not  place a carriage return & line feed at
  50.                          the end of output file records.
  51.  
  52.           First:         The  string   of  characters   placed  at  the
  53.                          beginning of each record.
  54.  
  55.           Last:          The string  of characters placed at the end of
  56.                          each  record.
  57.  
  58.           Delimiter:     The string  of  characters  placed  after each
  59.                          field except the last.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.           Input:         The input  file path  and name.  If you do not
  67.                          enter an input file name at run time this file
  68.                          will be used.
  69.  
  70.           Output:        The output  file path and name.  If you do not
  71.                          enter an output file  name  at  run  time this
  72.                          file will be used.
  73.  
  74.           These  directives  may  appear  in  any  order.  They must be
  75.           followd by the field specifications.   Each field  is defined
  76.           by a  one line  entry in the map file.  The entry consists of
  77.           the starting  position  of  the  field  in  the  input record
  78.           followed by the ending position, and optiontionally, followed
  79.           by a string of characters to be inserted  after the  field in
  80.           the output  record.   If no character string is specified the
  81.           string following the Delimiter keyword  will  be  used.   The
  82.           fields will  be placed in the output record in the order that
  83.           they are listed in the map file.   The following  is a sample
  84.           map file.
  85.  
  86.           Optionally, the field specifications may begin with the field
  87.           name. The name is not used by the program but may be included
  88.           for reference.   The  field name  MUST begin with a semicolon
  89.           and may not contain any blanks.
  90.  
  91.                Size 125
  92.                First "
  93.                Last "<05>
  94.                Delimiter ","
  95.                Input in_file
  96.                Output out_file
  97.                Noreturn
  98.                ;name 1 20
  99.                ;acct-number 30 35
  100.                ;month 24 25 /
  101.                ;day 26 27 /
  102.                ;year 22 23
  103.  
  104.           All items on the same line must be  separated by  one or more
  105.           spaces. To  include spaces  in the  delimiter strings use the
  106.           tilde (~).
  107.  
  108.           You may also include any character in a string by placing its
  109.           decimal value in brackets,  for example,  <05> would  place a
  110.           Ctrl-E in  the string.  The only way to place the < character
  111.           in a string is by using its decimal value, <60>.
  112.  
  113.           The sample above reads a file consisting of records which are
  114.           125  bytes  long.    The  output record will consist of bytes
  115.           1-20, 30-35, 24-25, 26-27 and  22-23  in  that  order.   Each
  116.           output record  will start  double quotation  mark (") and end
  117.           with a double quotation mark followed by a Ctrl-E (<05>).
  118.  
  119.           Each field will  be  followed  by  the  three  characters ","
  120.  
  121.  
  122.  
  123.  
  124.  
  125.           except  24-25  and  26-27  which  will be followed by /.  The
  126.           output records will not be terminated with a  carriage return
  127.           and line feed.
  128.  
  129.           For batch  operation the  file names  may be specified on the
  130.           command line.  For example:
  131.  
  132.                FILTER MAP_FILE_NAME IN_FILE_NAME OUT_FILE_NAME
  133.  
  134.           The file  names must  be given  in the  order shown.   If the
  135.           input and output file names are given in the map file they do
  136.           not have to be specified on the command line.
  137.  
  138.           To stop the program while the  file is  being processed press
  139.           any key and hold it for about two seconds.
  140.  
  141.           Program limits are:
  142.  
  143.                Input record size:            8192 bytes.
  144.                Output record size:           8192 bytes.
  145.                Number of fields:             512.
  146.                Length of delimiter strings:  64 characters.
  147.  
  148.  
  149.